#define _CRT_SECURE_NO_WARNINGS 1

#include"List.h"

void TestList1()
{
	ListNode* plist = ListCreat();

	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPushBack(plist, 5);

	ListPrint(plist);

	ListPushFront(plist, 6);
	ListPushFront(plist, 7);
	ListPushFront(plist, 8);
	ListPushFront(plist, 9);
	ListPushFront(plist, 10);

	ListPrint(plist);

	ListPopBack(plist);
	ListPopBack(plist);
	ListPopBack(plist);
	ListPopBack(plist);
	ListPrint(plist);

	ListPopFront(plist);
	ListPopFront(plist);
	ListPopFront(plist);
	ListPopFront(plist);
	ListPrint(plist);

}
void TestList2()
{
	ListNode* plist = ListCreat();

	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPushBack(plist, 5);

	ListPrint(plist);
	ListNode* pos = ListFind(plist, 3);
	(pos->data) *= 10;
	ListPrint(plist);
	ListInsert(pos, 20);
	ListPrint(plist);

	ListErase(pos);
	ListPrint(plist);

}
int main()
{
	//TestList1();
	TestList2();
	return 0;
}